﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

namespace MyXnaGame
{
    public class AnimatedSprite: Sprite
    {
        // variables for sprite animation
        protected Animation idleAnimation, runAnimation, jumpAnimation;
        protected Vector2 speed = Vector2.Zero;

        protected bool direction = true;
        protected float time;
        protected int frameIndex = 1;

        public Vector2 SpriteSpeed { get { return speed; } set { speed = value; } }

        public AnimatedSprite()
        {
        }

        public AnimatedSprite(Vector2 position): base(position)
        {
        }

        public override void LoadContent(ContentManager content, string contentLocation)
        {
            idleAnimation = new Animation(content.Load<Texture2D>("Sprites/" + contentLocation + "/Idle"), 0.1f);
            runAnimation = new Animation(content.Load<Texture2D>("Sprites/" + contentLocation + "/Run"), 0.1f);
            jumpAnimation = new Animation(content.Load<Texture2D>("Sprites/" + contentLocation + "/Jump"), 0.1f);

            base.LoadContent(content, contentLocation);
        }

        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
        }

        public override void Draw(SpriteBatch spriteBatch)
        {
            base.Draw(spriteBatch);
        }
    }
}
